Skip to content

rt: automatically align .text by default - #692

Merged
adamgreig merged 1 commit into
rust-embedded:masterfrom
Dirbaio:fix-text-align
Sep 22, 2026
Merged

adamgreig merged 1 commit into
rust-embedded:masterfrom
Dirbaio:fix-text-align

Conversation

@Dirbaio

@Dirbaio Dirbaio commented Sep 22, 2026

Copy link
Copy Markdown
Member

Fixes #678

An alternative I considered is this:

PROVIDE(_stext = ADDR(.vector_table) + SIZEOF(.vector_table));
. = _stext;
.text :
{
  __stext = .;
  ...
}

This lets the linker align the section itself naturally, which is arguably more "idiomatic" (if such a concept can ever exist for linker scripts) but thi means _stext and __stext can have different values which is too much of a footgun.

adamgreig
adamgreig previously approved these changes Sep 22, 2026
@adamgreig
adamgreig enabled auto-merge September 22, 2026 20:27
auto-merge was automatically disabled September 22, 2026 20:29

Head branch was pushed to by a user without write access

@adamgreig
adamgreig added this pull request to the merge queue Sep 22, 2026
Merged via the queue into rust-embedded:master with commit 6cc1bc2 Sep 22, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warning from linker about alignment of .text section

3 participants